package com.fuxin.ribbon.web;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.client.RestTemplate;

@RestController
public class RibbonController {

    @Autowired
    RestTemplate restTemplate;


    @RequestMapping("hello")
    public String helloRibbon(@RequestParam(value = "param", defaultValue = "", required = false) String param){
        String result = restTemplate.getForObject("http://SERVER/hello?param=" + param,String.class);
        return "helloRibbon:" + result;
    }
}
